package cn.yeyiu.sexyiu.fragment;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;

import androidx.fragment.app.Fragment;

import cn.yeyiu.sexyiu.R;
import cn.yeyiu.sexyiu.activity.AnimeListActivity;
import cn.yeyiu.sexyiu.activity.MangaActivity;
import cn.yeyiu.sexyiu.activity.OtherListActivity;
import cn.yeyiu.sexyiu.activity.RandomVideoActivity;
import cn.yeyiu.util.NetConfig;

public class HomeFragment extends Fragment {
    private View _3d;
    private View _short;
    private View anime;
    private ImageView hostIv;
    private View live2d;
    private View manga;
    private View mmd;
    private View motion;
    private View normal;

    @Override // androidx.fragment.app.Fragment
    public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        View inflate = layoutInflater.inflate(R.layout.fragment_home, viewGroup, false);
        viewInit(inflate);
        eventInit();
        return inflate;
    }

    /* access modifiers changed from: package-private */
    public void viewInit(View view) {
        this.hostIv = (ImageView) view.findViewById(R.id.home_back_iv);
        this.hostIv.startAnimation(AnimationUtils.loadAnimation(getActivity(), R.anim.anim_rotation));
        this.anime = view.findViewById(R.id.anime_ll);
        this.normal = view.findViewById(R.id.normal_ll);
        this.manga = view.findViewById(R.id.manga_ll);
        this.motion = view.findViewById(R.id.motion_ll);
        this.live2d = view.findViewById(R.id.live2d_ll);
        this._short = view.findViewById(R.id.short_ll);
        this._3d = view.findViewById(R.id._3d_ll);
        this.mmd = view.findViewById(R.id.mmd_ll);
        view.findViewById(R.id.logo).startAnimation(AnimationUtils.loadAnimation(getActivity(), R.anim.anim_trans));
    }

    /* access modifiers changed from: package-private */
    public void eventInit() {
        this.hostIv.setOnClickListener(v->{
            Intent intent = new Intent(requireActivity(), RandomVideoActivity.class);
            startActivity(intent);
        });
        this.anime.setOnClickListener(v->{
            startActivity(new Intent(getActivity(), AnimeListActivity.class));

        });
        this.normal.setOnClickListener(v->{
            Intent intent = new Intent(getActivity(), OtherListActivity.class);
            intent.putExtra("ctg", "normal");
            startActivity(intent);
        });
        this.manga.setOnClickListener(v->{
            Intent intent = new Intent(getActivity(), MangaActivity.class);
            intent.putExtra("ctg", "manga");
            startActivity(intent);
        });
        this.motion.setOnClickListener(v->{
            Intent intent = new Intent(getActivity(), OtherListActivity.class);
            intent.putExtra("ctg", "motion");
            startActivity(intent);
        });
        this.live2d.setOnClickListener(v->{
            Intent intent = new Intent(getActivity(), OtherListActivity.class);
            intent.putExtra("ctg", "live2d");
            startActivity(intent);
        });
        this._short.setOnClickListener(v->{
            Intent intent = new Intent(getActivity(), OtherListActivity.class);
            intent.putExtra("ctg", "short");
            startActivity(intent);
        });
        this._3d.setOnClickListener(v->{
            Intent intent = new Intent(getActivity(), OtherListActivity.class);
            intent.putExtra("ctg", "3d");
            startActivity(intent);
        });
        this.mmd.setOnClickListener(v->{
            Intent intent = new Intent(getActivity(), OtherListActivity.class);
            intent.putExtra("ctg", "mmd");
            startActivity(intent);
        });
    }
}
